
 <!DOCTYPE HTML>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  
    <title>Spacemacs常用快捷键操作 | RyanHuen</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="RyanHuen">
    

    
    <meta name="description" content="文件操作
spc-f下的常用操作：









快捷键
描述





spc-f
文件操作前缀




f
查找文件、打开文件




L
在整个系统中查找文件




o
使用外部程序打开文件




E
sudo edit




D
删除当前buffer对应的文件以及buffer




j
打开dired-mode




r
打开最近文件




R
重命名当前文件




y">
<meta property="og:type" content="article">
<meta property="og:title" content="Spacemacs常用快捷键操作">
<meta property="og:url" content="http://www.ryanhuen.tech/2017/02/09/Spacemacs_KeyMap/index.html">
<meta property="og:site_name" content="RyanHuen">
<meta property="og:description" content="文件操作
spc-f下的常用操作：









快捷键
描述





spc-f
文件操作前缀




f
查找文件、打开文件




L
在整个系统中查找文件




o
使用外部程序打开文件




E
sudo edit




D
删除当前buffer对应的文件以及buffer




j
打开dired-mode




r
打开最近文件




R
重命名当前文件




y">
<meta property="og:updated_time" content="2017-02-15T00:53:05.638Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Spacemacs常用快捷键操作">
<meta name="twitter:description" content="文件操作
spc-f下的常用操作：









快捷键
描述





spc-f
文件操作前缀




f
查找文件、打开文件




L
在整个系统中查找文件




o
使用外部程序打开文件




E
sudo edit




D
删除当前buffer对应的文件以及buffer




j
打开dired-mode




r
打开最近文件




R
重命名当前文件




y">

    
    <link rel="alternative" href="/atom.xml" title="RyanHuen" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      
<div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="RyanHuen" title="RyanHuen"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="RyanHuen">RyanHuen</a></h1>
				<h2 class="blog-motto">I hope I can protect the one thing I can&#39;t live without.</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">首页</a></li>
					
						<li><a href="/archives">历程</a></li>
					
						<li><a href="/categories">分类</a></li>
					
						<li><a href="/tags">标签</a></li>
					
						<li><a href="/about">关于</a></li>
					
					<li>
 					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
						<input type="hidden" name="q" value="site:www.ryanhuen.tech">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
  
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2017/02/09/Spacemacs_KeyMap/" title="Spacemacs常用快捷键操作" itemprop="url">Spacemacs常用快捷键操作</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="RyanHuen" target="_blank" itemprop="author">RyanHuen</a>
		
  <p class="article-time">
    <time datetime="2017-02-09T10:57:07.000Z" itemprop="datePublished"> 发表于 2017-02-09</time>
    
  </p>
</header>
	<div class="article-content">
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">文章目录</strong>
		
			<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#文件操作"><span class="toc-number">1.</span> <span class="toc-text">文件操作</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-f下的常用操作："><span class="toc-number">1.1.</span> <span class="toc-text">spc-f下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#buffer操作："><span class="toc-number">2.</span> <span class="toc-text">buffer操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-b下的常用操作："><span class="toc-number">2.1.</span> <span class="toc-text">spc-b下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#layout操作："><span class="toc-number">3.</span> <span class="toc-text">layout操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-l下的常用操作："><span class="toc-number">3.1.</span> <span class="toc-text">spc-l下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#window操作："><span class="toc-number">4.</span> <span class="toc-text">window操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-w下的常用操作："><span class="toc-number">4.1.</span> <span class="toc-text">spc-w下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#project操作："><span class="toc-number">5.</span> <span class="toc-text">project操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-p下的常用操作："><span class="toc-number">5.1.</span> <span class="toc-text">spc-p下的常用操作：</span></a></li></ol></li></ol>
		
		</div>
		
		<p><a id="org14c59f4"></a></p>
<h1 id="文件操作"><a href="#文件操作" class="headerlink" title="文件操作"></a>文件操作</h1><p><a id="org32035ef"></a></p>
<h2 id="spc-f下的常用操作："><a href="#spc-f下的常用操作：" class="headerlink" title="spc-f下的常用操作："></a>spc-f下的常用操作：</h2><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col class="org-left">

<col class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">描述</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">spc-f</td>
<td class="org-left">文件操作前缀</td>
</tr>


<tr>
<td class="org-left">f</td>
<td class="org-left">查找文件、打开文件</td>
</tr>


<tr>
<td class="org-left">L</td>
<td class="org-left">在整个系统中查找文件</td>
</tr>


<tr>
<td class="org-left">o</td>
<td class="org-left">使用外部程序打开文件</td>
</tr>


<tr>
<td class="org-left">E</td>
<td class="org-left">sudo edit</td>
</tr>


<tr>
<td class="org-left">D</td>
<td class="org-left">删除当前buffer对应的文件以及buffer</td>
</tr>


<tr>
<td class="org-left">j</td>
<td class="org-left">打开dired-mode</td>
</tr>


<tr>
<td class="org-left">r</td>
<td class="org-left">打开最近文件</td>
</tr>


<tr>
<td class="org-left">R</td>
<td class="org-left">重命名当前文件</td>
</tr>


<tr>
<td class="org-left">y</td>
<td class="org-left">复制当前文件的全路径到剪贴板并打印</td>
</tr>


<tr>
<td class="org-left">C</td>
<td class="org-left">d/u 转换字符编码为dos/unix</td>
</tr>


<tr>
<td class="org-left">e-d</td>
<td class="org-left">查找.spacemacs/.spacemacs.d/init.el</td>
</tr>


<tr>
<td class="org-left">e-i</td>
<td class="org-left">查找 .emacs/.emacs.d/init.el init</td>
</tr>


<tr>
<td class="org-left">e-l</td>
<td class="org-left">查找所有.el结尾的生效文件</td>
</tr>


<tr>
<td class="org-left">c</td>
<td class="org-left">复制文件</td>
</tr>


<tr>
<td class="org-left">s/S</td>
<td class="org-left">保存buffer</td>
</tr>
</tbody>
</table>


<p><a id="org2e5285d"></a></p>
<h1 id="buffer操作："><a href="#buffer操作：" class="headerlink" title="buffer操作："></a>buffer操作：</h1><p><a id="org7d05d39"></a></p>
<h2 id="spc-b下的常用操作："><a href="#spc-b下的常用操作：" class="headerlink" title="spc-b下的常用操作："></a>spc-b下的常用操作：</h2><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col class="org-left">

<col class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">描述</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">SPC b .</td>
<td class="org-left">buffer的一些快捷操作，切换、关闭等</td>
</tr>


<tr>
<td class="org-left">SPC b b</td>
<td class="org-left">切换buffer</td>
</tr>


<tr>
<td class="org-left">SPC b d</td>
<td class="org-left">关闭buffer（不保存）</td>
</tr>


<tr>
<td class="org-left">SPC b f</td>
<td class="org-left">在osx的finder中打开某个文件或目录（仅用于Mac OS X）</td>
</tr>


<tr>
<td class="org-left">SPC b h</td>
<td class="org-left">跳转到spacemacs的首页</td>
</tr>


<tr>
<td class="org-left">SPC b k</td>
<td class="org-left">kill掉制定的buffer</td>
</tr>


<tr>
<td class="org-left">SPC b N</td>
<td class="org-left">打开一个空buffer</td>
</tr>


<tr>
<td class="org-left">SPC b m</td>
<td class="org-left">清楚其他所有buffer</td>
</tr>


<tr>
<td class="org-left">SPC b R</td>
<td class="org-left">安全回复所有buffer（没尝试过，不知道效果如何）</td>
</tr>


<tr>
<td class="org-left">SPC b s</td>
<td class="org-left">切换到scratch-buffer，方便测试等使用</td>
</tr>


<tr>
<td class="org-left">SPC b Y</td>
<td class="org-left">把当前buffer所有内容添加到剪贴板</td>
</tr>


<tr>
<td class="org-left">SPC b P</td>
<td class="org-left">粘贴到整个buffer</td>
</tr>


<tr>
<td class="org-left">SPC &lt;tab&gt;</td>
<td class="org-left">在两个buffer之间来回切换</td>
</tr>
</tbody>
</table>


<p><a id="org42b4088"></a></p>
<h1 id="layout操作："><a href="#layout操作：" class="headerlink" title="layout操作："></a>layout操作：<a id="org4f1c0b5"></a></h1><p><a id="org3de5634"></a></p>
<h2 id="spc-l下的常用操作："><a href="#spc-l下的常用操作：" class="headerlink" title="spc-l下的常用操作："></a>spc-l下的常用操作：</h2><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col class="org-left">

<col class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">描述</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">spc-l</td>
<td class="org-left">layout操作前缀</td>
</tr>


<tr>
<td class="org-left">L</td>
<td class="org-left">加载layout信息</td>
</tr>


<tr>
<td class="org-left">l</td>
<td class="org-left">切换layout</td>
</tr>


<tr>
<td class="org-left">s</td>
<td class="org-left">保存layout的信息到某个文件中</td>
</tr>


<tr>
<td class="org-left">o</td>
<td class="org-left">custom layout</td>
</tr>


<tr>
<td class="org-left">R</td>
<td class="org-left">rename layout</td>
</tr>


<tr>
<td class="org-left">?</td>
<td class="org-left">to open the help window, learn more operations about laout</td>
</tr>


<tr>
<td class="org-left">&lt;tab&gt;</td>
<td class="org-left">switch between the last layout and the current layout</td>
</tr>
</tbody>
</table>


<p><a id="orgf9d4e2c"></a></p>
<h1 id="window操作："><a href="#window操作：" class="headerlink" title="window操作："></a>window操作：</h1><p><a id="org55becea"></a></p>
<h2 id="spc-w下的常用操作："><a href="#spc-w下的常用操作：" class="headerlink" title="spc-w下的常用操作："></a>spc-w下的常用操作：</h2><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col class="org-left">

<col class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">描述</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">SPC t g</td>
<td class="org-left">toggle golden ratio</td>
</tr>


<tr>
<td class="org-left">SPC t -</td>
<td class="org-left">center point</td>
</tr>
</tbody>

<tbody>
<tr>
<td class="org-left">spc-w</td>
<td class="org-left">window操作前缀</td>
</tr>


<tr>
<td class="org-left">.</td>
<td class="org-left">window的一些快捷操作，切换、调整大小、跳转等</td>
</tr>


<tr>
<td class="org-left">-</td>
<td class="org-left">在下方分割窗口</td>
</tr>


<tr>
<td class="org-left">=</td>
<td class="org-left">均分窗口</td>
</tr>


<tr>
<td class="org-left">b</td>
<td class="org-left">光标重新回到minibuffer中，比如搜索框中</td>
</tr>


<tr>
<td class="org-left">d</td>
<td class="org-left">关闭当前窗口</td>
</tr>


<tr>
<td class="org-left">m</td>
<td class="org-left">最大化当前窗口</td>
</tr>


<tr>
<td class="org-left">w</td>
<td class="org-left">逐个窗口切换</td>
</tr>


<tr>
<td class="org-left">W</td>
<td class="org-left">ace window</td>
</tr>


<tr>
<td class="org-left">u/U</td>
<td class="org-left">window undo/redo</td>
</tr>


<tr>
<td class="org-left">2/3</td>
<td class="org-left">均分成2/3个window</td>
</tr>


<tr>
<td class="org-left">h/j/k/l</td>
<td class="org-left">按照方向切换window</td>
</tr>


<tr>
<td class="org-left">H/J/K/L</td>
<td class="org-left">按照方向移动window</td>
</tr>
</tbody>
</table>


<p><a id="orgee9f43a"></a></p>
<h1 id="project操作："><a href="#project操作：" class="headerlink" title="project操作："></a>project操作：</h1><p><a id="org748a2ab"></a></p>
<h2 id="spc-p下的常用操作："><a href="#spc-p下的常用操作：" class="headerlink" title="spc-p下的常用操作："></a>spc-p下的常用操作：</h2><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col class="org-left">

<col class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">描述</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">SPC p f</td>
<td class="org-left">visit files in project</td>
</tr>


<tr>
<td class="org-left">SPC p b</td>
<td class="org-left">visit buffers in project</td>
</tr>


<tr>
<td class="org-left">SPC p p</td>
<td class="org-left">switch to project</td>
</tr>


<tr>
<td class="org-left">SPC p l</td>
<td class="org-left">切换到需要的工程，并为这个工程的文件创建一个layout</td>
</tr>
</tbody>
</table>

<ul>
<li>补充内容：<a href="#org4f1c0b5">layout操作相关内容</a></li>
</ul>
  
	</div>
		<footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Emacs系列/">Emacs系列</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Spacemacs/">Spacemacs</a><a href="/tags/Emacs/">Emacs</a>
  </div>

</div>



	<div class="article-share" id="share">
	
	  <div data-url="http://www.ryanhuen.tech/2017/02/09/Spacemacs_KeyMap/" data-title="Spacemacs常用快捷键操作 | RyanHuen" data-tsina="null" class="share clearfix">
	  </div>
	
	</div>


</footer>

   	       
	</article>
	
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2017/02/10/git_intro_install/" title="git基本使用">
  <strong>上一篇：</strong><br/>
  <span>
  git基本使用</span>
</a>
</div>


</nav>

	
<section id="comments" class="comment">
	<div class="ds-thread" data-thread-key="2017/02/09/Spacemacs_KeyMap/" data-title="Spacemacs常用快捷键操作" data-url="http://www.ryanhuen.tech/2017/02/09/Spacemacs_KeyMap/"></div>
</section>


</div>  
      <div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">文章目录</strong>
 
 <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#文件操作"><span class="toc-number">1.</span> <span class="toc-text">文件操作</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-f下的常用操作："><span class="toc-number">1.1.</span> <span class="toc-text">spc-f下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#buffer操作："><span class="toc-number">2.</span> <span class="toc-text">buffer操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-b下的常用操作："><span class="toc-number">2.1.</span> <span class="toc-text">spc-b下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#layout操作："><span class="toc-number">3.</span> <span class="toc-text">layout操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-l下的常用操作："><span class="toc-number">3.1.</span> <span class="toc-text">spc-l下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#window操作："><span class="toc-number">4.</span> <span class="toc-text">window操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-w下的常用操作："><span class="toc-number">4.1.</span> <span class="toc-text">spc-w下的常用操作：</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#project操作："><span class="toc-number">5.</span> <span class="toc-text">project操作：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#spc-p下的常用操作："><span class="toc-number">5.1.</span> <span class="toc-text">spc-p下的常用操作：</span></a></li></ol></li></ol>
 
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">分类</p>
		<ul>
		
		  
			<li><a href="/categories/Emacs系列/" title="Emacs系列">Emacs系列<sup>3</sup></a></li>
		  
		
		  
			<li><a href="/categories/Framework系列/" title="Framework系列">Framework系列<sup>1</sup></a></li>
		  
		
		  
			<li><a href="/categories/RXJava系列/" title="RXJava系列">RXJava系列<sup>7</sup></a></li>
		  
		
		  
			<li><a href="/categories/git入门系列/" title="git入门系列">git入门系列<sup>5</sup></a></li>
		  
		
		  
			<li><a href="/categories/Emacs系列/org-mode/" title="org-mode">org-mode<sup>1</sup></a></li>
		  
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">标签</p>
		<ul class="clearfix">
		
			
				<li><a href="/tags/RxJava/" title="RxJava">RxJava<sup>7</sup></a></li>
			
		
			
				<li><a href="/tags/git/" title="git">git<sup>5</sup></a></li>
			
		
			
				<li><a href="/tags/RxJava基础/" title="RxJava基础">RxJava基础<sup>4</sup></a></li>
			
		
			
				<li><a href="/tags/Spacemacs/" title="Spacemacs">Spacemacs<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/Emacs/" title="Emacs">Emacs<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/观察者模式/" title="观察者模式">观察者模式<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/BackPressure/" title="BackPressure">BackPressure<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/org/" title="org">org<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/Java回调/" title="Java回调">Java回调<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/Debug/" title="Debug">Debug<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/设计模式/" title="设计模式">设计模式<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/RxJava操作符/" title="RxJava操作符">RxJava操作符<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/响应式编程/" title="响应式编程">响应式编程<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/Android-Studio/" title="Android Studio">Android Studio<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/Framework/" title="Framework">Framework<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/org-mode/" title="org-mode">org-mode<sup>1</sup></a></li>
			
		
		</ul>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hi there,I&#39;m RyanHuen <br/>
			A simple programmer</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		<a href="http://weibo.com/ryanxuan" target="_blank" class="icon-weibo" title="微博"></a>
		
		
		<a href="https://github.com/RyanHuen" target="_blank" class="icon-github" title="github"></a>
		
		
		
		
		
		
		
		<a href="http://www.zhihu.com/people/ryan-hyn" target="_blank" class="icon-zhihu" title="知乎"></a>
		
		
		
		<a href="mailto:ryanhuenwork@163.com" target="_blank" class="icon-email" title="Email Me"></a>
		
	</div>
			
		

		<p class="copyright">
		Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2017 
		
		<a href="/about" target="_blank" title="RyanHuen">RyanHuen</a>
		
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  c.click(function(){
    ta.css('display', 'block').addClass('fadeIn');
  });
  o.click(function(){
    ta.css('display', 'none');
  });
  $(window).scroll(function(){
    ta.css("top",Math.max(140,320-$(this).scrollTop()));
  });
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina'),
      description = $this.attr('description');
  var html = [
  '<div class="hoverqrcode clearfix"></div>',
  '<a class="overlay" id="qrcode"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
  '<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);

  $('.hoverqrcode').hide();

  var myWidth = 0;
  function updatehoverqrcode(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
    var qrsize = myWidth > 1024 ? 200:100;
    var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
    var p = $('.article-share-qrcode').position();
    $('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
                          .css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
                          .qrcode(options);
  };
  $(window).resize(function(){
    $('.hoverqrcode').hide();
  });
  $('.article-share-qrcode').click(function(){
    updatehoverqrcode();
    $('.hoverqrcode').toggle();
  });
  $('.article-share-qrcode').hover(function(){}, function(){
      $('.hoverqrcode').hide();
  });
});   
</script>



<script type="text/javascript">
  var duoshuoQuery = {short_name:"ryanhuen"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 







<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->



<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?af124d045b4aed59105f75db52359992";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>



<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="返回顶部"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

  </body>
</html>
